package wiki.generic.concretecontents;

import java.util.List;

import wiki.generic.contents.Content;
import wiki.generic.med.ViewingService;
/**
 * 
 * @author <p><strong>JwTeam</strong></p> 
 *
 */
public class Immagine extends ConcreteContent{

	private ViewingService ps;
	
	
	public Immagine(String nome, String type, int ID, List<String> attributes, ViewingService ps) {
		super(nome, type, ID, attributes);
		this.ps=ps;
	}

	@Override
	public String getHTMLCode() {
		
		String code="<img src='"+ps.getContentMainParameterbyID(type, ID).getInfo()+"'";
		code+=" alt='"+nome;
		code+="' title='"+nome;
		code+="' style='";
		for (int i = 0; i < attributes.size(); i++) {
			code+=attributes.get(i)+" ";
		}
		code+="'/>";
		return code;
	}

	@Override
	public Content clone() {
		return new Immagine(nome, type, ID, attributes, ps);
	}

}
